Modify Profile properties
The profile properties such as geometry, feature definition etc. can be modified. The below code snippet shows how this can be achieved.
internal void ChangeProfileProperties(Profile profile)
{
//Get active connection object
Bentley.CifNET.SDK.Edit.ConsensusConnectionEdit con = ConsensusConnectionEdit.GetActive();
//To save changes to dgn
con.StartTransientMode();
//set new feature definition to profile
string featureDef = "Alignment\\Geom_Baseline_Driveway";
profile.SetFeatureDefinition(featureDef);
//Set new geometry to profile
Bentley.GeometryNET.DPoint3d[] points = { new DPoint3d(100, 100), new DPoint3d(600, 110), new DPoint3d(1000, 105) };
Bentley.CifNET.LinearGeometry.ProfileElement element = ProfileElement.Create1(450.0, 750.0, points);
profile.AssignGeometry(element);
//To save changes to dgn
con.PersistTransients();
}